package com.qiaofang.dataprocessing.facade.impl;

import com.qiaofang.common.request.DataRequest;
import com.qiaofang.common.request.PageRequest;
import com.qiaofang.common.response.DataResultResponse;
import com.qiaofang.dataprocessing.service.PropertyEntrustService;
import com.qiaofang.dataprocessing.stub.bean.PageCustomizeDTO;
import com.qiaofang.dataprocessing.stub.bean.request.PropertyEntrustRequest;
import com.qiaofang.dataprocessing.stub.bean.response.PropertyEntrustDTO;
import com.qiaofang.dataprocessing.stub.facade.MiniProgramPropertyEntrustFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: youqing.yang
 * @Create: 2020/12/15 16:04
 * @Description:
 **/
@RestController
public class MiniProgramPropertyEntrustFacadeImpl implements MiniProgramPropertyEntrustFacade {

    @Autowired
    PropertyEntrustService propertyEntrustService;

    @Override
    public DataResultResponse<PageCustomizeDTO<PropertyEntrustDTO>> getPropertyEntrustPage(@RequestBody PageRequest<PropertyEntrustRequest> request) {
        return DataResultResponse.ok(propertyEntrustService.getPropertyEntrustPage(request.getParam(), request.getPage()));
    }

    @Override
    public DataResultResponse<Object> acceptEntrustMyself(@RequestBody DataRequest<Long> request) {
        return DataResultResponse.ok(propertyEntrustService.acceptEntrustMyself(request.getParam()));
    }
}
